import axios from 'axios'

export default async function({ name, config, data }) {
  if (name !== 'Hitokoto') {
    return { name, config, data }
  }

  const res = await axios({
    url: 'http://v1.hitokoto.cn',
    params: {
      c: config.type
    }
  })
  return {
    name,
    config,
    data: res.data
  }
}
